# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tokenizers
pkgver=0.15.2
pkgrel=1
pkgdesc="Fast State-of-the-Art Tokenizers optimized for Research and Production"
url="https://github.com/huggingface/tokenizers"
arch="all !s390x !riscv64" # blocked by rust
license="Apache-2.0"
depends="python3"
makedepends="
	bzip2-dev
	cargo
	openssl-dev>3
	py3-gpep517
	py3-maturin
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/huggingface/tokenizers/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/tokenizers-$pkgver/bindings/python"
options="net !check" # requires pulling test data


build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/tokenizers*.whl
}

sha512sums="
0635d074d98a74d171a5f113c1b6f8b8c80c9f36b2d3b82c18d90d3fc1f1daaec55b7e98f2d771d5b22593b888ab4561e8f3e3152170c22605e034ee84d6a10a  py3-tokenizers-0.15.2.tar.gz
"
